//package com.example;
//
//import com.example.entity.*;
//import com.example.service.DriverService;
//import com.example.service.OrderService;
//
//import java.util.Scanner;
//
//public class App {
//    private static final OrderService orderService = new OrderService();
//    private static final DriverService driverService = new DriverService();
//
//    public static void main(String[] args) {
//        Scanner scanner = new Scanner(System.in);
//
//        while (true) {
//            System.out.println("\n=== 网约车系统 ===");
//            System.out.println("1. 乘客下单");
//            System.out.println("2. 查看订单状态");
//            System.out.println("3. 司机加盟申请");
//            System.out.println("4. 退出系统");
//            System.out.print("请选择操作：");
//
//            int choice = scanner.nextInt();
//            scanner.nextLine();
//
//            switch (choice) {
//                case 1:
//                    handlePassengerOrder(scanner);
//                    break;
//                case 2:
//                    handleViewOrderStatus(scanner);
//                    break;
//                case 3:
//                    handleDriverJoinApplication(scanner);
//                    break;
//                case 4:
//                    System.out.println("系统已退出");
//                    return;
//                default:
//                    System.out.println("无效选择");
//            }
//        }
//    }
//
//    private static void handlePassengerOrder(Scanner scanner) {
//        System.out.print("请输入起点经度：");
//        double startLng = scanner.nextDouble();
//        System.out.print("请输入起点纬度：");
//        double startLat = scanner.nextDouble();
//        System.out.print("请输入终点经度：");
//        double endLng = scanner.nextDouble();
//        System.out.print("请输入终点纬度：");
//        double endLat = scanner.nextDouble();
//        System.out.println("请选择车型：");
//        System.out.println("1. 经济型");
//        System.out.println("2. 专车");
//        System.out.println("3. 自动驾驶");
//        int typeChoice = scanner.nextInt();
//        scanner.nextLine();
//
//        OrderType orderType = OrderType.values()[typeChoice - 1];
//
//        Order order = orderService.createOrder(new Passenger("张三"), orderType,
//                startLat, startLng, endLat, endLng);
//
//        if (order != null) {
//            System.out.println("订单创建成功！订单编号：" + order.getId());
//            System.out.println("预估费用：" + order.getTotalFare() + "元");
//            if (order.getAssignedVehicle() != null) {
//                System.out.println("已为您匹配车辆：" + order.getAssignedVehicle().getLicensePlate());
//            } else {
//                System.out.println("当前无可用车辆");
//            }
//        } else {
//            System.out.println("当前无可用车辆");
//        }
//    }
//
//    private static void handleViewOrderStatus(Scanner scanner) {
//        System.out.print("请输入要查询的订单编号：");
//        String orderId = scanner.nextLine();
//        Order order = orderService.getOrderById(orderId);
//        if (order != null) {
//            System.out.println("订单编号：" + order.getId());
//            System.out.println("订单状态：" + order.getStatus());
//            if (order.getAssignedVehicle() != null) {
//                System.out.println("匹配车辆：" + order.getAssignedVehicle().getLicensePlate());
//            }
//            System.out.println("预估费用：" + order.getTotalFare() + "元");
//        } else {
//            System.out.println("未找到该订单。");
//        }
//    }
//
//    private static void handleDriverJoinApplication(Scanner scanner) {
//        System.out.print("请输入司机姓名：");
//        String name = scanner.nextLine();
//        System.out.print("请输入驾驶证编号：");
//        String licenseNumber = scanner.nextLine();
//        System.out.print("请输入车辆牌照：");
//        String vehicleLicensePlate = scanner.nextLine();
//
//        Driver driver = new Driver(name, licenseNumber, vehicleLicensePlate);
//        driverService.applyForJoining(driver);
//    }
//}